﻿<r:RibbonWindow x:Class="FRCDock.MainWnd"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"                
    xmlns:me="clr-namespace:CheckbookManager;assembly=FRCDock"
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock" 
    xmlns:vdr="clr-namespace:WPFVDRUtility;assembly=FRCDock"
    xmlns:local="clr-namespace:FRCDock;assembly=FRCDock" 
    xmlns:cm="clr-namespace:CheckbookManager;assembly=FRCDock"
    Title="Crystal Studio" MinHeight="300" MinWidth="300" WindowStartupLocation="CenterScreen" WindowState="Maximized" Loaded="Window_Loaded" Closing="Window_Closing" Background="Gray">

    <DockPanel LastChildFill="True">
        <DockPanel.LayoutTransform>
            <ScaleTransform ScaleX="1" ScaleY="1"/>
        </DockPanel.LayoutTransform>

        <r:Ribbon DockPanel.Dock="Top" Title="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Window}},Path=Title}">
            <r:Ribbon.Resources>
                <r:RibbonGroupSizeDefinitionCollection x:Key="RibbonLayout">
                    <r:RibbonGroupSizeDefinition>
                        <!-- Control sizes: L,L,L -->
                        <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                        <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                        <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                    </r:RibbonGroupSizeDefinition>
                    <r:RibbonGroupSizeDefinition>
                        <!-- Control sizes: L,M,M -->
                        <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                        <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True"/>
                        <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="True"/>
                    </r:RibbonGroupSizeDefinition>
                    <r:RibbonGroupSizeDefinition>
                        <!-- Control sizes: L,S,S -->
                        <r:RibbonControlSizeDefinition ImageSize="Large" IsLabelVisible="True"/>
                        <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                        <r:RibbonControlSizeDefinition ImageSize="Small" IsLabelVisible="False"/>
                    </r:RibbonGroupSizeDefinition>
                    <!-- Collapsed -->
                    <r:RibbonGroupSizeDefinition IsCollapsed="True" />
                </r:RibbonGroupSizeDefinitionCollection>
            </r:Ribbon.Resources>

            <!-- Define the application icon in the org -->
            <r:Ribbon.ApplicationMenu>
                <r:RibbonApplicationMenu>
                    <r:RibbonApplicationMenu.Command>
                        <r:RibbonCommand 
                            Executed="OnCloseApplication"
                            LabelTitle="Application Button"
                            LabelDescription="Close the application."
                            SmallImageSource="images/Coins.png"
                            LargeImageSource="images/Coins.png"
                            ToolTipTitle="Personal Finance Manager"
                            ToolTipDescription="Click here to open or save a checkbook register." />
                    </r:RibbonApplicationMenu.Command>
                    <r:RibbonApplicationMenuItem>
                        <r:RibbonApplicationMenuItem.Command>
                            <r:RibbonCommand 
                                LabelTitle="_Close" 
                                LabelDescription="Close the Application"
                                Executed="OnCloseApplication" />
                        </r:RibbonApplicationMenuItem.Command>
                    </r:RibbonApplicationMenuItem>
                </r:RibbonApplicationMenu>
            </r:Ribbon.ApplicationMenu>

            <!-- Quick pick menu -->
            <r:Ribbon.QuickAccessToolBar>
                <r:RibbonQuickAccessToolBar CanUserCustomize="True">
                    <r:RibbonButton Command="me:AppCommands.AddNew" r:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                    <r:RibbonButton Command="me:AppCommands.Cut" r:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                    <r:RibbonButton Command="me:AppCommands.Copy" r:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                    <r:RibbonButton Command="me:AppCommands.Paste"  r:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                    <r:RibbonButton Command="me:AppCommands.Help" r:RibbonQuickAccessToolBar.Placement="InToolBar" />
                </r:RibbonQuickAccessToolBar>
            </r:Ribbon.QuickAccessToolBar>

            <r:RibbonTab Label="Banking">
                <!-- Define the groups in this tab -->
                <r:RibbonTab.Groups>
                    <!-- Clipboard commands -->
                    <r:RibbonGroup GroupSizeDefinitions="{StaticResource RibbonLayout}">
                        <r:RibbonGroup.Command>
                            <r:RibbonCommand LabelTitle="Clipboard" SmallImageSource="images/Paste.png" />
                        </r:RibbonGroup.Command>
                        <r:RibbonButton Command="me:AppCommands.Cut"/>
                        <r:RibbonButton Command="me:AppCommands.Copy"/>
                        <r:RibbonButton Command="me:AppCommands.Paste"/>
                    </r:RibbonGroup>

                    <r:RibbonGroup GroupSizeDefinitions="{StaticResource RibbonLayout}">
                        <r:RibbonGroup.Command>
                            <r:RibbonCommand LabelTitle="Checkbook" SmallImageSource="images/AddNew.png" />
                        </r:RibbonGroup.Command>
                        <r:RibbonButton Command="me:AppCommands.AddNew"/>
                        <r:RibbonButton Command="me:AppCommands.Clear" />
                        <r:RibbonButton Command="me:AppCommands.Delete"/>
                    </r:RibbonGroup>

                    <r:RibbonGroup GroupSizeDefinitions="{StaticResource RibbonLayout}">
                        <r:RibbonGroup.Command>
                            <r:RibbonCommand LabelTitle="Statements" SmallImageSource="images/Reconcile.png" />
                        </r:RibbonGroup.Command>
                        <r:RibbonButton Command="me:AppCommands.Reconcile"/>
                    </r:RibbonGroup>

                    <r:RibbonGroup GroupSizeDefinitions="{StaticResource RibbonLayout}">
                        <r:RibbonGroup.Command>
                            <r:RibbonCommand LabelTitle="Online" SmallImageSource="images/CreditCards.png" />
                        </r:RibbonGroup.Command>
                        <r:RibbonButton Command="me:AppCommands.DownloadStatements"/>
                        <r:RibbonButton Command="me:AppCommands.DownloadCreditCards"/>
                        <r:RibbonButton Command="me:AppCommands.Transfer"/>
                    </r:RibbonGroup>
                    <r:RibbonGroup GroupSizeDefinitions="{StaticResource RibbonLayout}">
                        <r:RibbonGroup.Command>
                            <r:RibbonCommand LabelTitle="Tools" SmallImageSource="images/Backup.png" />
                        </r:RibbonGroup.Command>
                        <r:RibbonButton Command="me:AppCommands.Backup"/>
                        <r:RibbonButton Command="me:AppCommands.Calculator"/>
                    </r:RibbonGroup>
                </r:RibbonTab.Groups>
            </r:RibbonTab>

            <r:RibbonTab Label="Reporting">
                <r:RibbonTab.Groups>
                    <r:RibbonGroup GroupSizeDefinitions="{StaticResource RibbonLayout}">
                        <r:RibbonGroup.Command>
                            <r:RibbonCommand LabelTitle="Reports" SmallImageSource="images/CashflowReport.png" />
                        </r:RibbonGroup.Command>
                        <r:RibbonButton Command="me:AppCommands.TrendReport" />
                        <r:RibbonButton Command="me:AppCommands.BudgetReport"/>
                        <r:RibbonDropDownButton Command="me:AppCommands.OtherReports">
                            <MenuItem Header="Cash Flow Report" />
                            <MenuItem Header="Favorites Report" />
                            <MenuItem Header="Spending Report" />
                            <MenuItem Header="Savings Report" />
                            <MenuItem Header="Credit Report" />
                        </r:RibbonDropDownButton>
                    </r:RibbonGroup>
                </r:RibbonTab.Groups>
            </r:RibbonTab>
        </r:Ribbon>


        <ContentControl x:Name="FRCContainer" Background="Gray">
            <ad:DockingManager x:Name="_dockingManager" Loaded="_dockingManager_Loaded">
                <ad:ResizingPanel Orientation="Vertical">                    
                    <ad:ResizingPanel Orientation="Horizontal" Background="Brown">
                        <ad:DockablePane>
                            <ad:DockableContent x:Name="_solutionExplorer" Title="Solution Explorer" DockableStyle="Dockable" >
                                <ad:DockableContent.Icon>
                                    <Image Source="Images\display.png" Height="16" Width="16"/>
                                </ad:DockableContent.Icon>
                                <Frame Source="SolutionExplorer.xaml"></Frame>
                            </ad:DockableContent>
                            <ad:DockableContent x:Name="_dataSource" Title="Data Sources" DockableStyle="DockableToBorders">
                                <ad:DockableContent.Icon>
                                    <Image Width="16" Height="16" Source="Images\database.png"/>
                                </ad:DockableContent.Icon>
                                <TabControl></TabControl>
                            </ad:DockableContent>
                            <ad:DockableContent x:Name="_resourceView" Title="Resource View">
                                <ad:DockableContent.Icon>
                                    <Image Width="16" Height="16" Source="Images\demo.png"/>
                                </ad:DockableContent.Icon>
                                <TextBox VerticalScrollBarVisibility="Auto" Margin="10" />
                            </ad:DockableContent>
                            <ad:DockableContent x:Name="_testView" Title="Test View">
                                <ad:DockableContent.Icon>
                                    <Image Width="16" Height="16" Source="Images\demo.png"/>
                                </ad:DockableContent.Icon>
                                <TextBox VerticalScrollBarVisibility="Auto" Margin="10" />
                            </ad:DockableContent>
                        </ad:DockablePane>
                        <ad:DocumentPane x:Name="_documentsHost" GotMouseCapture="_documentsHost_GotMouseCapture">
                            <ad:DocumentContent Title="Start Page" InfoTip="" ContentTypeDescription="XPS document">
                                <FlowDocumentScrollViewer>
                                    <FlowDocument FontFamily="Segoue">                                       
                                        <Paragraph>
                                            Following list of commands give access to the functionalities:
                                            <LineBreak/>
                                            <Hyperlink x:Name="NewDocuments" Click="NewDocuments_Click">Add documents</Hyperlink>
                                            <LineBreak/>
                                            <Hyperlink x:Name="ShowProperties" Click="ShowProperties_Click">Show Solution explorer</Hyperlink> (
                                            <Hyperlink x:Name="ShowProperties_AutoHide" Click="ShowProperties_Click">Autohide</Hyperlink>
                                            <Hyperlink x:Name="ShowProperties_FloatingWindow"  Click="ShowProperties_Click">Floating window</Hyperlink> )
                                            <LineBreak/>
                                            <Hyperlink x:Name="ShowExplorer" Click="ShowExplorer_Click">Show explorer window</Hyperlink> (
                                            <Hyperlink x:Name="ShowExplorer_AutoHide" Click="ShowExplorer_Click">Autohide</Hyperlink>
                                            <Hyperlink x:Name="ShowExplorer_FloatingWindow"  Click="ShowExplorer_Click">Floating window</Hyperlink> )
                                            <LineBreak/>
                                            <Hyperlink x:Name="ShowEventsLog" Click="ShowEventsLog_Click">Show events log window</Hyperlink> (
                                            <Hyperlink x:Name="ShowEventsLog_AutoHide" Click="ShowEventsLog_Click">Autohide</Hyperlink>
                                            <Hyperlink x:Name="ShowEventsLog_FloatingWindow"  Click="ShowEventsLog_Click">Floating window</Hyperlink>
                                            <Hyperlink x:Name="ShowEventsLog_DockRight"  Click="ShowEventsLog_Click">Right docked</Hyperlink> )
                                            <LineBreak/>
                                            <Hyperlink x:Name="ShowProperty" Click="ShowProperty_Click">Show object explorer window</Hyperlink> (
                                            <Hyperlink x:Name="ShowProperty_AutoHide" Click="ShowProperty_Click">Autohide</Hyperlink>
                                            <Hyperlink x:Name="ShowProperty_FloatingWindow"  Click="ShowProperty_Click">Floating window</Hyperlink>
                                            <Hyperlink x:Name="ShowProperty_DockRight"  Click="ShowProperty_Click">Right docked</Hyperlink> )
                                            <LineBreak/>
                                            <Hyperlink x:Name="SaveLayout" Click="SaveLayout_Click">Save layout</Hyperlink>
                                            <Hyperlink x:Name="RestoreLayout"  Click="RestoreLayout_Click">Restore layout</Hyperlink>
                                        </Paragraph>
                                    </FlowDocument>
                                </FlowDocumentScrollViewer>
                            </ad:DocumentContent>
                            <ad:DockableContent Title="Dashboard">
                                <Grid>
                                    <Frame Source="Dashboard.xaml"></Frame>
                                </Grid>
                            </ad:DockableContent>
                            <ad:DockableContent Title="Dynamic Data">
                                <Grid>
                                    <Frame Source="dynamicData.xaml"></Frame>
                                </Grid>                                       
                            </ad:DockableContent>
                            <ad:DockableContent Title="Chart">
                                <Grid>
                                    <Frame Source="VisifireChart.xaml"></Frame>
                                </Grid>
                            </ad:DockableContent>
                            <ad:DockableContent Title="Terminal">
                                <Grid>
                                    <Frame Source="VDRUtil.xaml"/>
                                </Grid>
                            </ad:DockableContent>
                        </ad:DocumentPane>                    
                        <ad:DockablePane  Padding="5">
                            <ad:DockableContent x:Name="_toolBox" Title="Toolbox" Padding="5">
                                <ad:DockableContent.Icon>
                                    <Image Width="16" Height="16" Source="Images\date.png"/>
                                </ad:DockableContent.Icon>
                            </ad:DockableContent>
                            <ad:DockableContent x:Name="_objectExplorerHost" Title="Object explorer" Padding="5">
                                <ad:DockableContent.Icon>
                                    <Image Width="16" Height="16" Source="Images\date.png"/>
                                </ad:DockableContent.Icon>
                            </ad:DockableContent>
                        </ad:DockablePane>
                    </ad:ResizingPanel>
                    <ad:DockablePane>
                        <ad:DockableContent x:Name="_outputWindow" Title="Output" DockableStyle="DockableToBorders">
                            <ad:DockableContent.Icon>
                                <Image Width="16" Height="16" Source="Images\database.png"/>
                            </ad:DockableContent.Icon>
                            <TabControl x:Name="tabControl"></TabControl>
                        </ad:DockableContent>
                        <ad:DockableContent x:Name="_eventsLogWindow" Title="Events log">
                            <ad:DockableContent.Icon>
                                <Image Width="16" Height="16" Source="Images\demo.png"/>
                            </ad:DockableContent.Icon>
                            <TextBox x:Name="_txtLog" VerticalScrollBarVisibility="Auto" Margin="10" />
                        </ad:DockableContent>
                        <ad:DockableContent x:Name="_commandWindows" Title="Command Windows">
                            <ad:DockableContent.Icon>
                                <Image Width="16" Height="16" Source="Images\demo.png"/>
                            </ad:DockableContent.Icon>
                            <TextBox x:Name="_txtCommand" VerticalScrollBarVisibility="Auto" Margin="10" />
                        </ad:DockableContent>
                    </ad:DockablePane>
                </ad:ResizingPanel>
            </ad:DockingManager>
        </ContentControl>
    </DockPanel>
</r:RibbonWindow>
